<?php
	session_start();
	if(!isset($_SESSION['account']))
		header("Location:index.php");


?>
<html>
<head>
  <link rel="stylesheet" type="text/css" href="css/header.css">
  <link rel="stylesheet" type="text/css" href="css/style.css">
  <script type="text/javascript" src="js/functions.js"></script>
   <script type="text/javascript">
	
	
	function getValue() {
		var nome = document.getElementById("denominazione").value;
		var codfis = document.getElementById("codfis").value;
		var piva = document.getElementById("piva").value;
		var pratica = document.getElementById("npratica").value;
		openAjaxRequest(nome, codfis, piva, pratica);
	}
	function openAjaxRequest(nome, codfis, piva, pratica) {
		if(XMLHttpRequest) {
			http=new XMLHttpRequest();
			http.open("GET", "search.php?nome="+nome+"&codfis="+codfis+"&piva="+piva+"&pratica="+pratica, true);
			http.onreadystatechange=funzione;
			http.send("");
		}
	}
	function funzione() {
		if(http.readyState==4 && http.status==200){
                    document.getElementById("result").innerHTML=http.responseText;
		}

	}
   </script>

</head>
<body>
      <?php include("header.php");
      ?>
  
      <div id="body">
      
          <fieldset >
              <legend>Ricerca finanziamenti</legend>
          	  <table>
          	  	<tr><td>Denominazione societ&agrave</td><td><input type="text" id="denominazione" size=30></input></td></tr>
          	  	<tr><td>Codice Fiscale</td><td><input type="text" id="codfis" size=30></input ></td></tr>
          	  	<tr><td>Partita IVA</td><td><input type="text" id="piva" size=30></input></td></tr>
          	  	<tr><td>Numero Pratica</td><td><input type="text" id="npratica" size=30></input></td></tr>
       	  </table>
          	   	
          </fieldset>
                    	    <input type="button" style="margin-top:30px;margin-left:40%"name="Ricerca" onclick="getValue()" value="Cerca">
                    	    
                            <br><br><br>
           <div id="result">
                
             </div>
      </div> 
   
  <script type="text/javascript">
  	activePage();
  
  </script>
  </body>



</html>